﻿using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;

namespace CoreLibrary.Collection {

    public class LockedQueue<T> : IProducerConsumerCollection<T> {

        private readonly object _locker = new object();
        private readonly LinkedList<T> _queue = new LinkedList<T>();
        
        public int Count {
            get {
                return _queue.Count;
            }
        }

        public object SyncRoot {
            get {
                return _queue.First;
            }
        }

        public bool IsSynchronized {
            get {
                return true;
            }
        }

        public IEnumerator<T> GetEnumerator() {
            return _queue.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return GetEnumerator();
        }

        public void CopyTo(Array array, int index) {
            _queue.CopyTo((T[])array, index);
        }

        public void CopyTo(T[] array, int index) {
            _queue.CopyTo(array, index);
        }

        public bool TryAdd(T item) {
            throw new NotImplementedException();
        }

        public bool TryTake(out T item) {
            throw new NotImplementedException();
        }

        public T[] ToArray() {
            throw new NotImplementedException();
        }

    }

}